package com.shrct.businessprocess.budget;

import com.shrct.businessprocess.budget.BudgetType;
import com.shrct.businessprocess.budget.BudgetTypeProvider;
import com.shrct.businessprocess.budget.RCB1Budget;
import com.shrct.businessprocess.budget.RCB2Budget;
import com.shrct.businessprocess.budget.RCBudgetCategory;
import com.shrct.businessprocess.budget.RCC3Budget;
import com.shrct.businessprocess.budget.RCC3BudgetType;
import com.shrct.businessprocess.budget.RCCostBreakDown;
import com.shrct.businessprocess.budget.RCEX1Budget;
import com.shrct.businessprocess.budget.RCEX2Budget;
import com.shrct.businessprocess.budget.RCEX2ExtBudget;
import com.shrct.businessprocess.budget.RCF1Budget;
import com.shrct.businessprocess.budget.RCF2Budget;
import com.shrct.businessprocess.budget.impl.RCB1BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCB2BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCC3BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCEX1BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCEX2BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCEX2ExtBudgetImpl;
import com.shrct.businessprocess.budget.impl.RCF1BudgetImpl;
import com.shrct.businessprocess.budget.impl.RCF2BudgetImpl;
import com.shrct.businessprocess.product.RCBrand;
import com.shrct.businessprocess.project.RCProject;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.purchase.RCAnonymousProductPurchaseBudget;
import com.shrct.businessprocess.purchase.RCCompanyQualityServiceBudget;
import com.shrct.businessprocess.purchase.RCNormalProductPurchaseBudget;
import com.shrct.businessprocess.purchase.impl.RCAnonymousProductPurchaseBudgetImpl;
import com.shrct.businessprocess.purchase.impl.RCCompanyQualityServiceBudgetImpl;
import com.shrct.businessprocess.purchase.impl.RCNormalProductPurchaseBudgetImpl;
import edu.fudan.langlab.domain.code.CodeService;
import edu.fudan.mylang.pf.IObjectFactory;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "CommonBudgetTypeRegister")
@SuppressWarnings("all")
public class BudgetTypeRegister implements BudgetTypeProvider {
  @Autowired
  private IObjectFactory objectFactory;
  
  private CodeService codeService;
  
  public Collection<BudgetType> getRegisteredBudgetTypes() {
    BudgetType _budgetType = new BudgetType("RCAXBudget", RCBudgetCategory.PartA, "\u8BBE\u5907\u4EA7\u54C1(\u53CA\u5173\u8054\u7EF4\u4FDD)", Boolean.valueOf(false));
    final Function1<RCProject,RCCompanyQualityServiceBudget> _function = new Function1<RCProject,RCCompanyQualityServiceBudget>() {
        public RCCompanyQualityServiceBudget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCCompanyQualityServiceBudget _create = RCCompanyQualityServiceBudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCCompanyQualityServiceBudget> _function = new Procedure1<RCCompanyQualityServiceBudget>() {
              public void apply(final RCCompanyQualityServiceBudget it) {
                Collection<RCBrand> _all = BudgetTypeRegister.this.objectFactory.<RCBrand>all(RCBrand.class);
                final Function1<RCBrand,Boolean> _function = new Function1<RCBrand,Boolean>() {
                    public Boolean apply(final RCBrand it) {
                      String _codeid = it.getCodeid();
                      boolean _equals = _codeid.equals("X01");
                      return Boolean.valueOf(_equals);
                    }
                  };
                RCBrand _findFirst = IterableExtensions.<RCBrand>findFirst(_all, _function);
                it.setProductCategory(_findFirst);
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setServiceContractPrice(_zeroAmount);
                it.setServiceContractTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_1 = project.getZeroAmount();
                it.setServiceNetPrice(_zeroAmount_1);
                it.setServiceNetTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_2 = project.getZeroAmount();
                it.setProductContractPrice(_zeroAmount_2);
                it.setProductContractTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_3 = project.getZeroAmount();
                it.setProductNetPrice(_zeroAmount_3);
                it.setProductNetTaxRate(Double.valueOf(0d));
              }
            };
          RCCompanyQualityServiceBudget _doubleArrow = ObjectExtensions.<RCCompanyQualityServiceBudget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_1 = new BudgetType("RCCompanyQualityServiceBudget", RCBudgetCategory.PartA, "\u516C\u53F8\u8D28\u4FDD", Boolean.valueOf(true), _function);
    final Function1<RCProject,RCAnonymousProductPurchaseBudget> _function_1 = new Function1<RCProject,RCAnonymousProductPurchaseBudget>() {
        public RCAnonymousProductPurchaseBudget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCAnonymousProductPurchaseBudget _create = RCAnonymousProductPurchaseBudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCAnonymousProductPurchaseBudget> _function = new Procedure1<RCAnonymousProductPurchaseBudget>() {
              public void apply(final RCAnonymousProductPurchaseBudget it) {
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setNetPrice(_zeroAmount);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCAnonymousProductPurchaseBudget _doubleArrow = ObjectExtensions.<RCAnonymousProductPurchaseBudget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_2 = new BudgetType("RCAZBudget", RCBudgetCategory.PartA, "\u8017\u6750", Boolean.valueOf(true), _function_1);
    BudgetType _budgetType_3 = new BudgetType("RCC1Budget", RCBudgetCategory.PartB, "\u8BBE\u5907\u7EED\u4FDD", Boolean.valueOf(false));
    BudgetType _budgetType_4 = new BudgetType("RCAYBudget", RCBudgetCategory.PartD, "\u5176\u4ED6\u4EA7\u54C1\u4E0E\u670D\u52A1", Boolean.valueOf(false));
    final Function1<RCProject,RCB1Budget> _function_2 = new Function1<RCProject,RCB1Budget>() {
        public RCB1Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCB1Budget _create = RCB1BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCB1Budget> _function = new Procedure1<RCB1Budget>() {
              public void apply(final RCB1Budget it) {
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setNetPrice(_zeroAmount);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCB1Budget _doubleArrow = ObjectExtensions.<RCB1Budget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_5 = new BudgetType("RCB1Budget", RCBudgetCategory.PartC, "\u8FD0\u4FDD\u8D39 \u3001\u8FDB\u53E3\u4EE3\u7406\u8D39", Boolean.valueOf(true), _function_2);
    final Function1<RCProject,RCB2Budget> _function_3 = new Function1<RCProject,RCB2Budget>() {
        public RCB2Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCB2Budget _create = RCB2BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCB2Budget> _function = new Procedure1<RCB2Budget>() {
              public void apply(final RCB2Budget it) {
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setNetPrice(_zeroAmount);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCB2Budget _doubleArrow = ObjectExtensions.<RCB2Budget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_6 = new BudgetType("RCB2Budget", RCBudgetCategory.PartC, "\u94F6\u884C\u8D39\u7528", Boolean.valueOf(true), _function_3);
    final Function1<RCProject,RCC3Budget> _function_4 = new Function1<RCProject,RCC3Budget>() {
        public RCC3Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCC3Budget _create = RCC3BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCC3Budget> _function = new Procedure1<RCC3Budget>() {
              public void apply(final RCC3Budget it) {
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setContractPrice(_zeroAmount);
                it.setContractTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_1 = project.getZeroAmount();
                it.setNetPrice(_zeroAmount_1);
                it.setNetTaxRate(Double.valueOf(0d));
                it.setType(RCC3BudgetType.P0);
              }
            };
          RCC3Budget _doubleArrow = ObjectExtensions.<RCC3Budget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_7 = new BudgetType("RCC3Budget", RCBudgetCategory.PartD, "\u516C\u53F8\u5DE5\u7A0B\u5E08\u670D\u52A1", Boolean.valueOf(true), _function_4);
    final Function1<RCProject,RCNormalProductPurchaseBudget> _function_5 = new Function1<RCProject,RCNormalProductPurchaseBudget>() {
        public RCNormalProductPurchaseBudget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCNormalProductPurchaseBudget _create = RCNormalProductPurchaseBudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCNormalProductPurchaseBudget> _function = new Procedure1<RCNormalProductPurchaseBudget>() {
              public void apply(final RCNormalProductPurchaseBudget it) {
                it.setName("\u7B2C\u4E09\u65B9\u5916\u5305\u670D\u52A1");
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setContractPrice(_zeroAmount);
                it.setContractTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_1 = project.getZeroAmount();
                it.setNetPrice(_zeroAmount_1);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCNormalProductPurchaseBudget _doubleArrow = ObjectExtensions.<RCNormalProductPurchaseBudget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_8 = new BudgetType("RCAYBudget", RCBudgetCategory.PartD, "\u7B2C\u4E09\u65B9\u5916\u5305\u670D\u52A1", Boolean.valueOf(true), _function_5);
    final Function1<RCProject,RCNormalProductPurchaseBudget> _function_6 = new Function1<RCProject,RCNormalProductPurchaseBudget>() {
        public RCNormalProductPurchaseBudget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCNormalProductPurchaseBudget _create = RCNormalProductPurchaseBudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCNormalProductPurchaseBudget> _function = new Procedure1<RCNormalProductPurchaseBudget>() {
              public void apply(final RCNormalProductPurchaseBudget it) {
                it.setName("\u57F9\u8BAD\u8D39");
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setContractPrice(_zeroAmount);
                it.setContractTaxRate(Double.valueOf(0d));
                RCProjectMoney _zeroAmount_1 = project.getZeroAmount();
                it.setNetPrice(_zeroAmount_1);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCNormalProductPurchaseBudget _doubleArrow = ObjectExtensions.<RCNormalProductPurchaseBudget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_9 = new BudgetType("RCAYBudget", RCBudgetCategory.PartD, "\u57F9\u8BAD", Boolean.valueOf(true), _function_6);
    final Function1<RCProject,RCEX1Budget> _function_7 = new Function1<RCProject,RCEX1Budget>() {
        public RCEX1Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCEX1Budget _create = RCEX1BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCEX1Budget> _function = new Procedure1<RCEX1Budget>() {
              public void apply(final RCEX1Budget it) {
                it.setName("\u5E02\u573A\u8D391");
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setNetPrice(_zeroAmount);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCEX1Budget _doubleArrow = ObjectExtensions.<RCEX1Budget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_10 = new BudgetType("RCEX1Budget", RCBudgetCategory.PartE, "\u5E02\u573A\u8D391", Boolean.valueOf(true), _function_7);
    final Function1<RCProject,RCEX2Budget> _function_8 = new Function1<RCProject,RCEX2Budget>() {
        public RCEX2Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCEX2Budget _create = RCEX2BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          final Procedure1<RCEX2Budget> _function = new Procedure1<RCEX2Budget>() {
              public void apply(final RCEX2Budget it) {
                it.setName("\u5E02\u573A\u8D392");
                RCProjectMoney _zeroAmount = project.getZeroAmount();
                it.setNetPrice(_zeroAmount);
                it.setNetTaxRate(Double.valueOf(0d));
              }
            };
          RCEX2Budget _doubleArrow = ObjectExtensions.<RCEX2Budget>operator_doubleArrow(_create, _function);
          return _doubleArrow;
        }
      };
    BudgetType _budgetType_11 = new BudgetType("RCEX2Budget", RCBudgetCategory.PartE, "\u5E02\u573A\u8D392", Boolean.valueOf(true), _function_8);
    final Function1<RCProject,RCEX2ExtBudget> _function_9 = new Function1<RCProject,RCEX2ExtBudget>() {
        public RCEX2ExtBudget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCEX2ExtBudget _create = RCEX2ExtBudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          return _create;
        }
      };
    BudgetType _budgetType_12 = new BudgetType("RCEX2ExtBudget", RCBudgetCategory.PartE, "\u9644\u52A0\u8D39", Boolean.valueOf(true), _function_9);
    final Function1<RCProject,RCF1Budget> _function_10 = new Function1<RCProject,RCF1Budget>() {
        public RCF1Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCF1Budget _create = RCF1BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          return _create;
        }
      };
    BudgetType _budgetType_13 = new BudgetType("RCF1Budget", RCBudgetCategory.PartF, "\u9500\u552E\u53D1\u7968\u7A0E", Boolean.valueOf(true), _function_10);
    final Function1<RCProject,RCF2Budget> _function_11 = new Function1<RCProject,RCF2Budget>() {
        public RCF2Budget apply(final RCProject project) {
          RCCostBreakDown _cbd = project.getCbd();
          RCF2Budget _create = RCF2BudgetImpl.create(_cbd, BudgetTypeRegister.this.objectFactory);
          return _create;
        }
      };
    BudgetType _budgetType_14 = new BudgetType("RCF2Budget", RCBudgetCategory.PartF, "\u9500\u552E\u9644\u52A0\u7A0E", Boolean.valueOf(true), _function_11);
    ArrayList<BudgetType> _newArrayList = CollectionLiterals.<BudgetType>newArrayList(_budgetType, _budgetType_1, _budgetType_2, _budgetType_3, _budgetType_4, _budgetType_5, _budgetType_6, _budgetType_7, _budgetType_8, _budgetType_9, _budgetType_10, _budgetType_11, _budgetType_12, _budgetType_13, _budgetType_14);
    return _newArrayList;
  }
}
